//
//  FGChatMessageModel.h
//  lite
//
//  Created by feige on 2022/10/20.
//

#import <Foundation/Foundation.h>
#import "FGTemplateModel.h"

// 消息类型
typedef NS_ENUM(NSInteger, FGChatMessageType) {
    FGChatMessageTypeSystem = 1,    // 系统消息
    FGChatMessageTypeCommon,        // 普通消息
    FGChatMessageTypeImage,         // 图片消息
    FGChatMessageTypeFile,          // 文件消息
    FGChatMessageTypeTemplate,      // 模版消息
};

// 消息发送状态
typedef NS_ENUM(NSInteger, FGChatMessageSendStatus) {
    FGChatMessageSendStatusInit,    // 消息创建
    FGChatMessageSendStatusSending, // 消息发送中
    FGChatMessageSendStatusSucc,    // 消息发送成功
    FGChatMessageSendStatusFail,    // 消息发送失败
};

NS_ASSUME_NONNULL_BEGIN

@interface FGChatMessageModel : NSObject
@property (nonatomic, copy) NSString *mid; ///< 消息id "1666244866104";
@property (nonatomic, copy) NSString *from; ///< 来自 "oyumt22850@conference.feige.im/1onrg7as1r";
@property (nonatomic, copy) NSString *to; ///< 到 "62@feige.im/8lc9pou3w1";
@property (nonatomic, copy) NSString *type; ///< 类型 "groupchat";
@property (nonatomic, copy) NSString *time; ///< 时间 1666244866325;
@property (nonatomic, copy) NSString *ofrom; ///< 原始来自谁jid
// body
@property (nonatomic, copy) NSString *status; ///< 身份 "visitor";
@property (nonatomic, copy) NSString *notice; ///< 内容 "888";
@property (nonatomic, copy) NSString *content; ///< 内容html "<p>888</p>";
@property (nonatomic, assign) FGChatMessageType msgType; ///< 消息类型 2;
@property (nonatomic, strong) NSNumber *websiteId; ///< 站点id 1;
@property (nonatomic, strong) NSNumber *companyId; ///< 公司id 1;
@property (nonatomic, copy) NSString *nickname; ///< 昵称
@property (nonatomic, copy) NSString *headImg; ///< 头像
@property (nonatomic, copy) NSString *quoteMsg; ///< 引用消息 "<p class=\"quotemsgtext\">倩倩: 网页消息<br> </p>"
// 文件消息特有字段
@property (nonatomic, copy) NSString *fileName; ///< 文件名
@property (nonatomic, copy) NSString *fileType; ///< 文件类型
@property (nonatomic, copy) NSString *fileSize; ///< 文件大小
// 模板消息特有字段
@property (nonatomic, assign) FGTemplateType tempType; ///< 模板类型
@property (nonatomic, strong) NSNumber *tempId; ///< 模板id
// custom
@property (nonatomic, copy) NSString *room; ///< 房间号
@property (nonatomic, assign) BOOL isSelfSend; ///< 是否自己发送
@property (nonatomic, assign) FGChatMessageSendStatus sendStatus; ///< 消息发送状态
@property (nonatomic, assign) CGFloat imageWidth; ///< 图片宽
@property (nonatomic, assign) CGFloat imageHeight; ///< 图片高
@property (nonatomic, copy) NSString *tempJson; ///< 模板json
@property (nonatomic, assign) BOOL isRead; ///< 是否已读
/// 是否系统消息
- (BOOL)isSystem;
@end

NS_ASSUME_NONNULL_END
